package com.dlg.user.web;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.dlg.user.entity.User;
import com.dlg.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class LoginController {
    @Autowired
    private IUserService userService;
    @RequestMapping(value = "/users",method = RequestMethod.GET)
    public String getUsers(String name) {
        User temp = new User();
        temp.setUserName(name);
        User user  =  userService.selectOne(new EntityWrapper<User>(temp));
       return user.getUserName();
    }
}
